<include file="Public:head" title='菜单详情' />
<script src="__PUBLIC__/js/other/validate.js"></script>
<script type="text/javascript">
    $(function() {
        $("#form").validate({
            errorPlacement: function(error, element) {
                var error_td = element.parent('td');
                error_td.find('label.error').hide();
                error_td.append(error);
            },
            rules: {
                name: {
                    required: true
                },
                shop_id: {
                    min: 1
                },
                cat_id: {
                    min: 1
                },
                price: {
                    checkPrice: true,
                    required: true
                }

            },
            messages: {
                name: {
                    required: '菜单名称不能为空'
                },
                shop_id: {
                    min: '请选择店铺'
                },
                cat_id: {
                    min: "请选择菜单类别"
                },
                price: {
                    checkPrice: "折扣不能大于原价",
                    required: "价格不能为空"
                }

            }
        });
    });
</script>
<div class="main-container" id="main-container">
    <div class="main-container-inner">
        <include file="Public:left" />
        <div class="main-content">
            <div class="breadcrumbs" id="breadcrumbs">
                <ul class="breadcrumb">
                    <li><i class="icon-home home-icon"></i><a href="__APP__/{$Think.MODULE_NAME}">首页</a></li>
                    <li><a href="{:U('Index/menus')}">菜单管理</a></li>
                    <li class="active">菜单列表</li>
                </ul>
            </div>
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="row">
                            <div class="col-xs-12">
                                <h3 class="header smaller lighter blue">菜单{$Think.get.id|getPageType}</h3>

                                <form action="{:U('Index/menu_detail_post')}" method="POST" id="form"  enctype="multipart/form-data" >
                                    <table class="table table_detail">
                                        <tbody>
                                            <tr>
                                                <td class="td_left">名称:</td>
                                                <td> 
                                                    <input name="name" type="text" class="common_txt" id="name"  value="{$detail.name}" maxlength="30" autocomplete="off"/>
                                                </td>
                                            </tr>
                                            <tr id="tr_name">
                                                <td class="td_left"> 上级菜单:</td>
                                                <td>
                                                    <select name="pid" id="pid" autocomplete="off">
                                                        <option value="0">请选择上级菜单</option>
                                                        <foreach name="menus" item="row">
                                                            <option value="{$row.id}"<if condition="$row.id eq $detail['pid']">selected</if>>
                                                            {$row.name}                                                
                                                            </option>
                                                        </foreach>
                                                    </select>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="td_left">Control:</td>
                                                <td> 
                                                    <input name="control" type="text" class="common_txt" id="control"  value="{$detail.control}" maxlength="30" autocomplete="off"/>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="td_left">mod:</td>
                                                <td> 
                                                    <input name="mod" type="text" class="common_txt" id="mod"  value="{$detail.mod}" maxlength="30" autocomplete="off"/>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="td_left">图标code:</td>
                                                <td> 
                                                    <input name="icon" type="text" class="common_txt" id="icon"  value="{$detail.icon}" maxlength="30" autocomplete="off"/>
                                                </td>
                                            </tr>

                                            <tr>
                                                <td class="td_left">排序:</td>
                                                <td>
                                                    <input name="ord" type="text" class="common_txt" value="{$detail.ord}" />
                                                </td>
                                            </tr>


                                            <tr>
                                                <td class="td_left">是否开启:</td>
                                                <td>
                                                    <input type="radio" name="is_check" value="0" autocomplete="off" 
                                        <if condition="$detail.is_check eq 0">checked</if>> 否
                                        <input type="radio" name="is_check" value="1" autocomplete="off" 
                                               <if condition="$detail.is_check eq 1">checked</if>> 是
                                        </td>
                                        </tr>
                                        <tr>
                                            <td class="td_left"></td>
                                            <td>
                                                <input type='hidden' name='id' value='{$Think.get.id}'/>
                                                <button class="btn btn-info btn-sm" type="submit">
                                                    <i class="icon-ok bigger-110 "></i>
                                                    保 存
                                                </button>
                                                <button class="btn btn-sm reset" type="button" onclick="goUrl(-1)">
                                                    <i class="icon-undo bigger-110"></i>
                                                    返 回
                                                </button>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <include file="Public:setting" />
    </div>
</div>
<div class="modal fade" id="modal_cat" data-id="0" data-modal="position"  tabindex="-1" role="dialog" aria-labelledby="modal_catLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" ></h4>
            </div>
            <div class="modal-body">
                名称：
                <input id="cat_name" type="text" class="common_txt" value="{$detail.ord}" maxlength="20" autocomplete="off"/>
            </div>
            <div class="modal-footer">
                <button class="btn btn-danger btn-xs ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" type="submit" role="button" aria-disabled="false" >
                    <span class="ui-button-text">
                        <i class="icon-trash bigger-110"></i>
                        确 定
                    </span>
                </button>
                <button class="btn btn-xs ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" type="button" role="button" aria-disabled="false" data-dismiss="modal">
                    <span class="ui-button-text">
                        <i class="icon-remove bigger-110"></i>
                        取 消
                    </span>
                </button>
            </div>
        </div>
    </div>
</div>
<include file="Public:foot" />